<?php echo $html->script(array("jquery.pagination.js","jquery-ui.js"));?>
<?php echo $this->Html->css('jquery.qtip');?>
<script type="text/javascript">
	function pageselectCallback(page_index, jq, items_per_page){
		page_index = page_index ==0 ? 1 : (page_index+1);
		var startIndex = parseInt(((page_index - 1) * items_per_page));
		var endIndex = parseInt(((page_index) * items_per_page));
		jQuery('#Searchresult ul').empty();
		jQuery('#hiddenresult ul li').each(function(i,obj){
			if(startIndex <= i && i < endIndex ){
				var new_content = jQuery(obj).clone();
				jQuery('#Searchresult ul').append(new_content);
			}
		});
		var totalPage = 0;
		try{
			totalPage = Math.ceil(parseInt(jQuery('#hiddenresult ul li').size())/items_per_page);
		}catch(ex){

		}
		jQuery('#pagePositionNum').empty().html('Page '+page_index+' of '+totalPage);
		return false;
	}

            // When document is ready, initialize pagination
            jQuery(document).ready(function(){
                jQuery('#viewNumPageItem ul li a').live('click',function(){
                    var $href = jQuery(this).attr('href');
                    $href = parseInt($href.replace('#',''));
                    // count entries inside the hidden content
                    var num_entries = jQuery('#hiddenresult ul li').length;
                    // Create content inside pagination element
                    jQuery("#Pagination").empty().pagination(num_entries, {
                        callback: pageselectCallback,
                        items_per_page: $href // Show only one item per page
                    });
                    jQuery(this).closest('ul').find('li span').each(function(i,$this){
                        var pageNum = jQuery(this).html();
                        jQuery(this).closest('li').empty().html('<a href="#'+pageNum+'">'+pageNum+'</a>');
                    });
                    jQuery(this).closest('li').empty().html('<span>'+$href+'</span>');
                    return false;
                }).eq(0).trigger('click') ;

                jQuery('#gotoPage button').click(function(){
                    var $pageNum = parseInt(jQuery('#gotoPage input[type=text]').val());
                    $pageNum = $pageNum - 1;
                    jQuery("#Pagination").trigger('setPage', [$pageNum]);
                });
                //initPagination();
				
				jQuery("a.switch_thumb").toggle(function(){
                    jQuery(".days_left").hide();
                    jQuery(this).addClass("swap");
                    jQuery("ul.display").fadeOut("fast", function() {
                        jQuery(this).fadeIn("fast",function(){
                            jQuery(this).find('.content_block p').each(function(){
                                jQuery(this).find('span:eq(0)').appendTo(jQuery(this));
                            });
                        }).addClass("thumb_view");
                    });
                }, function () {
                    jQuery(".days_left").show();
					jQuery(this).removeClass("swap");
                    jQuery("ul.display").fadeOut("fast", function() {
                        jQuery(this).fadeIn("fast",function(){
                            jQuery(this).find('.content_block p').each(function(){
                                jQuery(this).find('span:last').prependTo(jQuery(this));
                            });
                        }).removeClass("thumb_view");


                    });
                });
				// bind change event to select
      jQuery('#dynamic_select').bind('change', function () {
          var url = jQuery(this).val(); // get selected value
          if (url) { // require a URL
              window.location = url; // redirect
          }
          return false;
      });
    });

var popupStatus1=0;
function showPop1(a){
centerPopup1(a);
loadPopup1();
var b="";var c="";var d="";
var e="";var f="";
if(jQuery(a).attr("title"))b=jQuery(a).attr("title");
if(jQuery(a).attr("controller"))c=jQuery(a).attr("controller");
if(jQuery(a).attr("action"))d=jQuery(a).attr("action");
if(jQuery(a).attr("ElmID"))e=jQuery(a).attr("ElmID");
if(jQuery(a).attr("ElmID2"))f=jQuery(a).attr("ElmID2");
var g=baseurl+c+"/";if(d!="")g+=d+"/";if(e!="")g+=e+"/";
if(f!="")g+=f+"/";
//g+=(new Date).getTime();

jQuery("#popupItems1").load(g,function(){
jQuery(".popupItems1").show();
jQuery("#loader1").hide();
jQuery(".popupArrow1").show();
});
}

function centerPopup1(a){
var b=document.documentElement.clientWidth;
var c=document.documentElement.clientHeight;
var d=jQuery(".popupWrapper1").height();
var e=jQuery(".popupWrapper1").width();
var scrollTop=jQuery(window).scrollTop();
left=b/2-e/2;
var target=jQuery(a).offset();
arrowTop=target.top;
var top=(screen.height-580)/2+scrollTop+50;
if(arrowTop<top){
top=arrowTop;
}
jQuery(".popupWrapper1").css({position:"absolute",top:top+"px",left:(target.left+200)+"px"})
jQuery(".popupArrow1").css({position:"absolute",top:arrowTop+30+"px",left:(left+67)+"px"});
}

function disablePopup1(){
if(popupStatus1==1){
jQuery("#popupItems1").find("*").remove();
jQuery(".popupArrow1").hide();
jQuery(".popupWrapper1").fadeOut();
popupStatus1=0
}
}
function loadPopup1(){
if(popupStatus1==0){
jQuery("#loader1").show();
jQuery(".popupWrapper1").fadeIn("slow");
popupStatus1=1
}
}

jQuery(document).ready(function(){
jQuery("#rightControl1").click(function(){
jQuery(".popupItems1:visible").hide().next().fadeIn("fast",function(){if(jQuery(".popupItems1").index(jQuery(this))==jQuery(".popupItems1").length-1){jQuery("#rightControl1").hide()}jQuery("#leftControl1").show()});
return false});
jQuery("#leftControl1").click(function(){
jQuery(".popupItems1:visible").hide().prev().fadeIn("fast",function(){if(jQuery(".popupItems1").index(jQuery(this))==0){jQuery("#leftControl1").hide()}jQuery("#rightControl1").show()});
return false}).hide();
jQuery("#rightControl1").click(function(){jQuery(".popupItems1:visible").hide().next().fadeIn("fast",function(){if(jQuery(".popupItems1").index(jQuery(this))==jQuery(".popupItems1").length-1){jQuery("#rightControl1").hide()}jQuery("#leftControl1").show()});
return false});jQuery("#leftControl1").click(function(){jQuery(".popupItems1:visible").hide().prev().fadeIn("fast",function(){if(jQuery(".popupItems1").index(jQuery(this))==0){jQuery("#leftControl1").hide()}jQuery("#rightControl1").show()});return false}).hide();jQuery(".linkList li a").click(function(){centerPopup();loadPopup();var a=jQuery(".linkList li a").index(jQuery(this));jQuery(".popupItems").hide();jQuery("#rightControl").hide();jQuery("#leftControl").hide();jQuery(".popupItems1").hide().eq(a).show();jQuery("#rightControl1").show();jQuery("#leftControl1").show();if(jQuery(".popupItems1").index(jQuery(".popupItems1:visible"))==jQuery(".popupItems1").length-1){jQuery("#rightControl1").hide()}if(jQuery(".popupItems1").index(jQuery(".popupItems1:visible"))==0){jQuery("#leftControl1").hide()}return false});

jQuery("a.popupClose1").click(function(){
disablePopup1();
return false});
jQuery(".wrapper1").click(function(){
disablePopup1()});
jQuery(document).keypress(function(a){if(a.keyCode==27&&popupStatus1==1){disablePopup1()}})
})
        </script>
        <!--[if lt IE 7]>
        <script type="text/javascript" src="js/DD_belatedPNG.js"></script>
        <script>
          DD_belatedPNG.fix('img,div');
        </script>
        <![endif]-->
<style type="text/css">
th,th a{font-size:14px; font-weight:700; text-decoration:none;}
.ui-tooltip-wiki{max-width: 550px;}
.ui-tooltip-wiki .ui-tooltip-content{padding: 10px;line-height: 12.5px;}
.ui-tooltip-wiki h1{margin: 0 0 7px;font-size: 1.5em;line-height: 1em;}
.ui-tooltip-wiki img{ padding: 0 10px 0 0; }
.ui-tooltip-wiki p{ margin-bottom: 9px; }
.ui-tooltip-wiki .note{ margin-bottom: 0; font-style: italic; color: #888; }
</style>
<a href="javascript:void(0);" class="popupArrow1">&nbsp;</a>
<div class="popupWrapper1">
	<a href="javascript:void(0);" class="popupClose1">&nbsp;</a>
	<div class="popupTop1">&nbsp;</div>
          <div class="popupContent1">
			<div id="loader1">loading...</div>		  
    	<div class="popupScroller1">
        	<div class="popContentWrapper1">
            	<div class="allHolder1">
                	<div id="popupItems1" class="popupItems1">
					
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="popupBottom">&nbsp;</div>
</div>